#makefile for SDL_net for PSP
#ported by kehon SDL_net library for SDL for psp

PSPSDK=$(shell psp-config --pspsdk-path)
PSPDEV=$(shell psp-config --psp-prefix)
PSPBIN=$(PSPDEV)/bin
INSTALL_DIR=$(shell $(PSPBIN)/sdl-config --prefix)/include/SDL

TARGET_LIB = libSDL_net.a
OBJS = SDLnet.o SDLnetselect.o SDLnetTCP.o SDLnetUDP.o 

INCDIR = 
CFLAGS = -O2 -G0 -Wall -g $(shell $(PSPBIN)/sdl-config --cflags) 
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

LIBDIR =
LDFLAGS =

LIBS = $(shell $(PSPBIN)/sdl-config --libs) -lcurl -lc -lpspuser 

include $(PSPSDK)/lib/build.mak

install:
	@mkdir -p $(INSTALL_DIR)
	cp -f SDL_net.h $(INSTALL_DIR)
	@mkdir -p $(shell $(PSPBIN)/sdl-config --prefix)/lib
	cp -f $(TARGET_LIB) $(shell $(PSPBIN)/sdl-config --prefix)/lib
	@echo
	@echo "** Headerfiles installed in $(INSTALL_DIR)"
	@echo "** Library files installed in $(shell $(PSPBIN)/sdl-config --prefix)/lib"